﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using OMIP.HMS.WPFBusiness;


namespace OMIP.HMS.WPFBusiness
{
        /// <summary>
        /// 实现抽象实体对象的属性和方法
        /// </summary>
        public abstract class Entity<T>: NotifyPropertyChangedObject where T:class
        {
                #region 构造函数

                /// <summary>
                /// 实体构造函数
                /// </summary>
                /// <param name="model"></param>
                public Entity(T model)
                {
                        Model = model;
                }

                #endregion

                /// <summary>
                /// 获取标识
                /// </summary>
                /// <value>
                /// 标识
                /// </value>
                public string Id
                {
                        get
                        {
                                dynamic d = Model;
                                return d.Id;
                        }
                }

                /// <summary>
                /// 获取或设置数据模型
                /// </summary>
                /// <value>
                /// 数据模型
                /// </value>
                public T Model { get; protected set; }

                ///// <summary>
                ///// 添加对象到数据库
                ///// </summary>
                //public abstract void Insert();

                ///// <summary>
                ///// 删除对象从数据库
                ///// </summary>
                //public abstract void Delete();


                ///// <summary>
                ///// 更新对象到数据库
                ///// </summary>
                //public abstract void Update();                
        }
}
